package com.viviman.service.impl;

import com.viviman.pojo.Product;
import com.viviman.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;

/**
 * @author Vivim
 */
@Service
public class ProductServiceImpl implements ProductService {

    @Autowired
    private RestTemplate restTemplate;

    @Override
    public Product selectProductById(Integer id) {
        // Todo ReUrl
        return restTemplate.getForObject("http://provider-server/product/" + id, Product.class);
    }
}
